﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

using Lucene.Net.Index;

namespace ERPStore.Indexers.Lucene.Workflows.Activities
{

	public sealed class OptimizeCatalog : CodeActivity
	{
		public InArgument<IndexWriter> IndexWriter { get; set; }

		protected override void Execute(CodeActivityContext context)
		{
			var indexWriter = context.GetValue(this.IndexWriter);

			indexWriter.Optimize();
		}
	}
}
